<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <canvas id="c" width="300" height="300" style="border: 1px solid #ccc"></canvas>

        <script>
            const cnv = document.getElementById('c')
            const cxt = cnv.getContext('2d')
            cxt.beginPath()
            // cxt.lineWidth =
            cxt.setLineDash([10, 5])

            cxt.arc(100, 100, 80, 0, Math.PI, true)
            cxt.closePath()
            cxt.stroke()
            let set = 0
            setInterval(() => {
                cxt.clearRect(0, 0, cnv.width, cnv.height)

                set = set + 5
                cxt.lineDashOffset = set
                cxt.stroke()
                // console.log('set',set)
            }, 500)
        </script>
    </body>
</html>
